/* Show The Email Tool */ function showemailtoolbox(state) { if (document.getElementById) { var arttool = document.getElementById("emailadexbox"); if(arttool != null){ setElementClass(arttool, state); movelayers("emailadexcontainer"); } } } /* Confirm Sent Email */ function confirmsent(status) { if (document.getElementById) { if (status!=1) { var arttool = document.getElementById("emailthiserror"); setElementClass(arttool, 'active'); return false; } else { var arttool = document.getElementById("emailconfirmation"); setElementClass(arttool, 'active'); var arttool2 = document.getElementById("emailthiserror"); setElementClass(arttool2, 'inactive'); var arttoolform = document.getElementById("emailform"); setElementClass(arttoolform, 'inactive'); return false; } } } /* Show The Submit Q Tool */ function showsubmitqtoolbox(state) { if (document.getElementById) { var arttool = document.getElementById("submitadexbox"); if(arttool != null){ setElementClass(arttool, state); movelayers("submitadexcontainer"); } } } /* Confirm Sent Submit Q */ function confirmsent2(state) { if (document.getElementById) { if (document.getElementById("Email").value == "") { var arttool = document.getElementById("submitqerror"); setElementClass(arttool, state); return false; } else { var arttool = document.getElementById("submitqconfirmation"); setElementClass(arttool, state); var arttool2 = document.getElementById("submitqerror"); setElementClass(arttool2, 'inactive'); var arttoolform = document.getElementById("submitqform"); setElementClass(arttoolform, 'inactive'); return false; } } } /* Script For Rate Form 1 */ function overstars1() { document.getElementById('star1').style.backgroundPosition='0px -14px'; } function offstars1() { document.getElementById('star1').style.backgroundPosition='0px 0px'; } function overstars2() { document.getElementById('star1').style.backgroundPosition='0px -14px'; document.getElementById('star2').style.backgroundPosition='0px -14px'; } function offstars2() { document.getElementById('star1').style.backgroundPosition='0px 0px'; document.getElementById('star2').style.backgroundPosition='0px 0px'; } function overstars3() { document.getElementById('star1').style.backgroundPosition='0px -14px'; document.getElementById('star2').style.backgroundPosition='0px -14px'; document.getElementById('star3').style.backgroundPosition='0px -14px'; } function offstars3() { document.getElementById('star1').style.backgroundPosition='0px 0px'; document.getElementById('star2').style.backgroundPosition='0px 0px'; document.getElementById('star3').style.backgroundPosition='0px 0px'; } function overstars4() { document.getElementById('star1').style.backgroundPosition='0px -14px'; document.getElementById('star2').style.backgroundPosition='0px -14px'; document.getElementById('star3').style.backgroundPosition='0px -14px'; document.getElementById('star4').style.backgroundPosition='0px -14px'; } function offstars4() { document.getElementById('star1').style.backgroundPosition='0px 0px'; document.getElementById('star2').style.backgroundPosition='0px 0px'; document.getElementById('star3').style.backgroundPosition='0px 0px'; document.getElementById('star4').style.backgroundPosition='0px 0px'; } function overstars5() { document.getElementById('star1').style.backgroundPosition='0px -14px'; document.getElementById('star2').style.backgroundPosition='0px -14px'; document.getElementById('star3').style.backgroundPosition='0px -14px'; document.getElementById('star4').style.backgroundPosition='0px -14px'; document.getElementById('star5').style.backgroundPosition='0px -14px'; } function offstars5() { document.getElementById('star1').style.backgroundPosition='0px 0px'; document.getElementById('star2').style.backgroundPosition='0px 0px'; document.getElementById('star3').style.backgroundPosition='0px 0px'; document.getElementById('star4').style.backgroundPosition='0px 0px'; document.getElementById('star5').style.backgroundPosition='0px 0px'; } function ratingset() { if (document.getElementById) { var whatrate2 = document.getElementById('passoffstar').value; changeDiv('yourratingtext', 'Your Rating:'); var topthreelist = document.getElementById("topthree"); setElementClass(topthreelist, 'active'); changeDiv('yourratingtext2', 'Your Rating:'); var topthreelist = document.getElementById("topthree"); setElementClass(topthreelist, 'active'); if (whatrate2 == "rating1") { var arttoolform = document.getElementById("ratearticleform"); setElementClass(arttoolform, 'inactive'); document.getElementById("yourratingstars").src= "http://images.medscape.com/pi/global/ornaments/rating-1star_sm.gif" var arttool = document.getElementById("ratingthanks"); setElementClass(arttool, 'active'); var arttoolform = document.getElementById("ratearticleform2"); setElementClass(arttoolform, 'inactive'); document.getElementById("yourratingstars2").src= "http://images.medscape.com/pi/global/ornaments/rating-1star_sm.gif" var arttool = document.getElementById("ratingthanks2"); setElementClass(arttool, 'active'); return false; } else if (whatrate2 == "rating2") { var arttoolform = document.getElementById("ratearticleform"); setElementClass(arttoolform, 'inactive'); document.getElementById("yourratingstars").src= "http://images.medscape.com/pi/global/ornaments/rating-2star_sm.gif" var arttool = document.getElementById("ratingthanks"); setElementClass(arttool, 'active'); var arttoolform = document.getElementById("ratearticleform2"); setElementClass(arttoolform, 'inactive'); document.getElementById("yourratingstars2").src= "http://images.medscape.com/pi/global/ornaments/rating-2star_sm.gif" var arttool = document.getElementById("ratingthanks2"); setElementClass(arttool, 'active'); return false; } else if (whatrate2 == "rating3") { var arttoolform = document.getElementById("ratearticleform"); setElementClass(arttoolform, 'inactive'); document.getElementById("yourratingstars").src= "http://images.medscape.com/pi/global/ornaments/rating-3star_sm.gif" var arttool = document.getElementById("ratingthanks"); setElementClass(arttool, 'active'); var arttoolform = document.getElementById("ratearticleform2"); setElementClass(arttoolform, 'inactive'); document.getElementById("yourratingstars2").src= "http://images.medscape.com/pi/global/ornaments/rating-3star_sm.gif" var arttool = document.getElementById("ratingthanks2"); setElementClass(arttool, 'active'); return false; } else if (whatrate2 == "rating4") { var arttoolform = document.getElementById("ratearticleform"); setElementClass(arttoolform, 'inactive'); document.getElementById("yourratingstars").src= "http://images.medscape.com/pi/global/ornaments/rating-4star_sm.gif" var arttool = document.getElementById("ratingthanks"); setElementClass(arttool, 'active'); var arttoolform = document.getElementById("ratearticleform2"); setElementClass(arttoolform, 'inactive'); document.getElementById("yourratingstars2").src= "http://images.medscape.com/pi/global/ornaments/rating-4star_sm.gif" var arttool = document.getElementById("ratingthanks2"); setElementClass(arttool, 'active'); return false; } else if (whatrate2 == "rating5") { var arttoolform = document.getElementById("ratearticleform"); setElementClass(arttoolform, 'inactive'); document.getElementById("yourratingstars").src= "http://images.medscape.com/pi/global/ornaments/rating-5star_sm.gif" var arttool = document.getElementById("ratingthanks"); setElementClass(arttool, 'active'); var arttoolform = document.getElementById("ratearticleform2"); setElementClass(arttoolform, 'inactive'); document.getElementById("yourratingstars2").src= "http://images.medscape.com/pi/global/ornaments/rating-5star_sm.gif" var arttool = document.getElementById("ratingthanks2"); setElementClass(arttool, 'active'); return false; } } } /* Script For Rate Form 2 */ function overstars2nd1() { document.getElementById('star2nd1').style.backgroundPosition='0px -14px'; } function offstars2nd1() { document.getElementById('star2nd1').style.backgroundPosition='0px 0px'; } function overstars2nd2() { document.getElementById('star2nd1').style.backgroundPosition='0px -14px'; document.getElementById('star2nd2').style.backgroundPosition='0px -14px'; } function offstars2nd2() { document.getElementById('star2nd1').style.backgroundPosition='0px 0px'; document.getElementById('star2nd2').style.backgroundPosition='0px 0px'; } function overstars2nd3() { document.getElementById('star2nd1').style.backgroundPosition='0px -14px'; document.getElementById('star2nd2').style.backgroundPosition='0px -14px'; document.getElementById('star2nd3').style.backgroundPosition='0px -14px'; } function offstars2nd3() { document.getElementById('star2nd1').style.backgroundPosition='0px 0px'; document.getElementById('star2nd2').style.backgroundPosition='0px 0px'; document.getElementById('star2nd3').style.backgroundPosition='0px 0px'; } function overstars2nd4() { document.getElementById('star2nd1').style.backgroundPosition='0px -14px'; document.getElementById('star2nd2').style.backgroundPosition='0px -14px'; document.getElementById('star2nd3').style.backgroundPosition='0px -14px'; document.getElementById('star2nd4').style.backgroundPosition='0px -14px'; } function offstars2nd4() { document.getElementById('star2nd1').style.backgroundPosition='0px 0px'; document.getElementById('star2nd2').style.backgroundPosition='0px 0px'; document.getElementById('star2nd3').style.backgroundPosition='0px 0px'; document.getElementById('star2nd4').style.backgroundPosition='0px 0px'; } function overstars2nd5() { document.getElementById('star2nd1').style.backgroundPosition='0px -14px'; document.getElementById('star2nd2').style.backgroundPosition='0px -14px'; document.getElementById('star2nd3').style.backgroundPosition='0px -14px'; document.getElementById('star2nd4').style.backgroundPosition='0px -14px'; document.getElementById('star2nd5').style.backgroundPosition='0px -14px'; } function offstars2nd5() { document.getElementById('star2nd1').style.backgroundPosition='0px 0px'; document.getElementById('star2nd2').style.backgroundPosition='0px 0px'; document.getElementById('star2nd3').style.backgroundPosition='0px 0px'; document.getElementById('star2nd4').style.backgroundPosition='0px 0px'; document.getElementById('star2nd5').style.backgroundPosition='0px 0px'; } function ratingpass2(state) { var whatrate = state; document.getElementById('passoffstar2').value = whatrate; } function ratingset2() { if (document.getElementById) { var whatrate2 = document.getElementById('passoffstar2').value; changeDiv('yourratingtext', 'Your Rating:'); var topthreelist = document.getElementById("topthree"); setElementClass(topthreelist, 'active'); changeDiv('yourratingtext2', 'Your Rating:'); var topthreelist = document.getElementById("topthree"); setElementClass(topthreelist, 'active'); if (whatrate2 == "rating1") { var arttoolform = document.getElementById("ratearticleform"); setElementClass(arttoolform, 'inactive'); document.getElementById("yourratingstars").src= "http://images.medscape.com/pi/global/ornaments/rating-1star_sm.gif" var arttool = document.getElementById("ratingthanks"); setElementClass(arttool, 'active'); var arttoolform = document.getElementById("ratearticleform2"); setElementClass(arttoolform, 'inactive'); document.getElementById("yourratingstars2").src= "http://images.medscape.com/pi/global/ornaments/rating-1star_sm.gif" var arttool = document.getElementById("ratingthanks2"); setElementClass(arttool, 'active'); return false; } else if (whatrate2 == "rating2") { var arttoolform = document.getElementById("ratearticleform"); setElementClass(arttoolform, 'inactive'); document.getElementById("yourratingstars").src= "http://images.medscape.com/pi/global/ornaments/rating-2star_sm.gif" var arttool = document.getElementById("ratingthanks"); setElementClass(arttool, 'active'); var arttoolform = document.getElementById("ratearticleform2"); setElementClass(arttoolform, 'inactive'); document.getElementById("yourratingstars2").src= "http://images.medscape.com/pi/global/ornaments/rating-2star_sm.gif" var arttool = document.getElementById("ratingthanks2"); setElementClass(arttool, 'active'); return false; } else if (whatrate2 == "rating3") { var arttoolform = document.getElementById("ratearticleform"); setElementClass(arttoolform, 'inactive'); document.getElementById("yourratingstars").src= "http://images.medscape.com/pi/global/ornaments/rating-3star_sm.gif" var arttool = document.getElementById("ratingthanks"); setElementClass(arttool, 'active'); var arttoolform = document.getElementById("ratearticleform2"); setElementClass(arttoolform, 'inactive'); document.getElementById("yourratingstars2").src= "http://images.medscape.com/pi/global/ornaments/rating-3star_sm.gif" var arttool = document.getElementById("ratingthanks2"); setElementClass(arttool, 'active'); return false; } else if (whatrate2 == "rating4") { var arttoolform = document.getElementById("ratearticleform"); setElementClass(arttoolform, 'inactive'); document.getElementById("yourratingstars").src= "http://images.medscape.com/pi/global/ornaments/rating-4star_sm.gif" var arttool = document.getElementById("ratingthanks"); setElementClass(arttool, 'active'); var arttoolform = document.getElementById("ratearticleform2"); setElementClass(arttoolform, 'inactive'); document.getElementById("yourratingstars2").src= "http://images.medscape.com/pi/global/ornaments/rating-4star_sm.gif" var arttool = document.getElementById("ratingthanks2"); setElementClass(arttool, 'active'); return false; } else if (whatrate2 == "rating5") { var arttoolform = document.getElementById("ratearticleform"); setElementClass(arttoolform, 'inactive'); document.getElementById("yourratingstars").src= "http://images.medscape.com/pi/global/ornaments/rating-5star_sm.gif" var arttool = document.getElementById("ratingthanks"); setElementClass(arttool, 'active'); var arttoolform = document.getElementById("ratearticleform2"); setElementClass(arttoolform, 'inactive'); document.getElementById("yourratingstars2").src= "http://images.medscape.com/pi/global/ornaments/rating-5star_sm.gif" var arttool = document.getElementById("ratingthanks2"); setElementClass(arttool, 'active'); return false; } } } /* Script For Rate Form 3 (This was set up for functional mock-ups only and probably will not be needed in final JS.) */ function overstars3rd1() { document.getElementById('star1').style.backgroundPosition='0px -14px'; } function offstars3rd1() { document.getElementById('star1').style.backgroundPosition='0px 0px'; } function overstars3rd2() { document.getElementById('star1').style.backgroundPosition='0px -14px'; document.getElementById('star2').style.backgroundPosition='0px -14px'; } function offstars3rd2() { document.getElementById('star1').style.backgroundPosition='0px 0px'; document.getElementById('star2').style.backgroundPosition='0px 0px'; } function overstars3rd3() { document.getElementById('star1').style.backgroundPosition='0px -14px'; document.getElementById('star2').style.backgroundPosition='0px -14px'; document.getElementById('star3').style.backgroundPosition='0px -14px'; } function offstars3rd3() { document.getElementById('star1').style.backgroundPosition='0px 0px'; document.getElementById('star2').style.backgroundPosition='0px 0px'; document.getElementById('star3').style.backgroundPosition='0px 0px'; } function overstars3rd4() { document.getElementById('star1').style.backgroundPosition='0px -14px'; document.getElementById('star2').style.backgroundPosition='0px -14px'; document.getElementById('star3').style.backgroundPosition='0px -14px'; document.getElementById('star4').style.backgroundPosition='0px -14px'; } function offstars3rd4() { document.getElementById('star1').style.backgroundPosition='0px 0px'; document.getElementById('star2').style.backgroundPosition='0px 0px'; document.getElementById('star3').style.backgroundPosition='0px 0px'; document.getElementById('star4').style.backgroundPosition='0px 0px'; } function overstars3rd5() { document.getElementById('star1').style.backgroundPosition='0px -14px'; document.getElementById('star2').style.backgroundPosition='0px -14px'; document.getElementById('star3').style.backgroundPosition='0px -14px'; document.getElementById('star4').style.backgroundPosition='0px -14px'; document.getElementById('star5').style.backgroundPosition='0px -14px'; } function offstars3rd5() { document.getElementById('star1').style.backgroundPosition='0px 0px'; document.getElementById('star2').style.backgroundPosition='0px 0px'; document.getElementById('star3').style.backgroundPosition='0px 0px'; document.getElementById('star4').style.backgroundPosition='0px 0px'; document.getElementById('star5').style.backgroundPosition='0px 0px'; } function ratingpass3(state) { var whatrate = state; document.getElementById('passoffstar').value = whatrate; changeDiv('yourratingtext', 'Your Rating:'); var topthreelist = document.getElementById("topthree"); setElementClass(topthreelist, 'active'); } function ratingset3() { if (document.getElementById) { var whatrate2 = document.getElementById('passoffstar').value; if (whatrate2 == "rating1") { var arttoolform = document.getElementById("ratearticleform"); setElementClass(arttoolform, 'inactive'); document.getElementById("yourratingstars").src= "http://images.medscape.com/pi/global/ornaments/rating-1star_sm.gif" var arttool = document.getElementById("ratingthanks"); setElementClass(arttool, 'active'); return false; } else if (whatrate2 == "rating2") { var arttoolform = document.getElementById("ratearticleform"); setElementClass(arttoolform, 'inactive'); document.getElementById("yourratingstars").src= "http://images.medscape.com/pi/global/ornaments/rating-2star_sm.gif" var arttool = document.getElementById("ratingthanks"); setElementClass(arttool, 'active'); return false; } else if (whatrate2 == "rating3") { var arttoolform = document.getElementById("ratearticleform"); setElementClass(arttoolform, 'inactive'); document.getElementById("yourratingstars").src= "http://images.medscape.com/pi/global/ornaments/rating-3star_sm.gif" var arttool = document.getElementById("ratingthanks"); setElementClass(arttool, 'active'); return false; } else if (whatrate2 == "rating4") { var arttoolform = document.getElementById("ratearticleform"); setElementClass(arttoolform, 'inactive'); document.getElementById("yourratingstars").src= "http://images.medscape.com/pi/global/ornaments/rating-4star_sm.gif" var arttool = document.getElementById("ratingthanks"); setElementClass(arttool, 'active'); return false; } else if (whatrate2 == "rating5") { var arttoolform = document.getElementById("ratearticleform"); setElementClass(arttoolform, 'inactive'); document.getElementById("yourratingstars").src= "http://images.medscape.com/pi/global/ornaments/rating-5star_sm.gif" var arttool = document.getElementById("ratingthanks"); setElementClass(arttool, 'active'); return false; } } } function showemailbox() { showsubmitqtoolbox('inactive'); showemailtoolbox('active'); movelayers('emailadexcontainer'); } function showsubmitbox() { showemailtoolbox('inactive'); showsubmitqtoolbox('active'); } function processEmailFormResponse(atarget, errtarget, awaitdiv, status, pageHTML) { handleFormSubmit(atarget, errtarget, awaitdiv, status, pageHTML); confirmsent(status) } function processSubmitThisResponse(atarget, errtarget, awaitdiv, status, pageHTML) { handleFormSubmit(atarget, errtarget, awaitdiv, status, pageHTML); submitthisconfirmsent(status) } function fillRateForm() { } function ratingpass(rating) { var whatrate = rating; document.getElementById('userRatingtop').value = whatrate; document.getElementById('userRatingbottom').value = whatrate; ratethis('rateform','adexratethiscontainertop', 'ratewait', handleRateResponse); } function handleRateResponse(atarget, errtarget, awaitdiv, status, pageHTML) { /*handleFormSubmit(atarget, errtarget, awaitdiv, status, pageHTML); showUserRatingBottom(); // no its not a typo. I really want to showbottomrating. Dont try to be oversmart !! var topthree = document.getElementById("topthree"); setElementClass(topthree, "inactive"); var bottomtarget = "adexratethiscontainerbottom"; handleFormSubmit(bottomtarget, errtarget, awaitdiv, status, pageHTML); showUserRatingBottom();*/ var bottomtarget = "adexratethiscontainerbottom"; handleFormSubmit(bottomtarget, errtarget, awaitdiv, status, pageHTML); showUserRatingBottom(); handleFormSubmit(atarget, errtarget, awaitdiv, status, pageHTML); showUserRatingBottom(); // no its not a typo. I really want to showbottomrating. Dont try to be oversmart !! var topthree = document.getElementById("topthree"); setElementClass(topthree, "inactive"); } var getRating; function handleFetchRatingTop() { getRating = document.rateform.getRating.value; var f = getRating == "0"; var g = getRating == ""; if (f || g) { ; } else { showUserRatingTop(); } } function handleFetchRatingBottom() { if (getRating) { var f = getRating == "0"; var g = getRating == ""; if (f || g) { ; } else { showUserRatingBottom(); } } } function showUserRatingTop() { var thanks = document.getElementById("ratingthankstop"); setElementClass(thanks, "active"); var aform = document.getElementById("starstop"); setElementClass(aform, "inactive"); } function showUserRatingBottom() { var thanksbottom = document.getElementById("ratingthanksbottom"); setElementClass(thanksbottom, "active"); var aformbottom = document.getElementById("starsbottom"); setElementClass(aformbottom, "inactive"); } function ratethis(aformId, atarget, awaitdiv, postf) { adexFormSubmit(aformId, atarget, undefined, awaitdiv, undefined, postf); } /* Confirm Sent Email */ function submitthisconfirmsent(status) { if (document.getElementById) { if (status!=1) { var arttool = document.getElementById("submitqerror"); setElementClass(arttool, 'active'); return false; } else { var arttool = document.getElementById("submitqconfirmation"); setElementClass(arttool, 'active'); var arttool2 = document.getElementById("submitqerror"); setElementClass(arttool2, 'inactive'); var arttoolform = document.getElementById("submitqform"); setElementClass(arttoolform, 'inactive'); return false; } } }